EXPORT_SYMBOL(synchronize_irq);
#endif
-static int noirqdebug;
-
-static int __init noirqdebug_setup(char *str)
-{
- noirqdebug = 1;
- printk("IRQ lockup detection disabled\n");
- return 1;
-}
-
-__setup("noirqdebug", noirqdebug_setup);
-
/*
* Generic enable/disable code: this just calls
* down into the PIC-specific version for the actual
return 1;
}
-/**
- * request_irq - allocate an interrupt line
- * @irq: Interrupt line to allocate
- * @handler: Function to be called when the IRQ occurs
- * @irqflags: Interrupt type flags
- * @devname: An ascii name for the claiming device
- * @dev_id: A cookie passed back to the handler function
- *
- * This call allocates interrupt resources and enables the
- * interrupt line and IRQ handling. From the point this
- * call is made your handler function may be invoked. Since
- * your handler function must clear any interrupt the board
- * raises, you must take care both to initialise your hardware
- * and to set up the interrupt handler in the right order.
- *
- * Dev_id must be globally unique. Normally the address of the
- * device data structure is used as the cookie. Since the handler
- * receives this value it makes sense to use it.
- *
- * If your interrupt is shared you must pass a non NULL dev_id
- * as this is required when freeing the interrupt.
- *
- * Flags:
- *
- * SA_SHIRQ Interrupt is shared
- *
- * SA_INTERRUPT Disable local interrupts while processing
- *
- * SA_SAMPLE_RANDOM The interrupt can be used for entropy
- *
- */
-
-int request_irq(unsigned int irq,
- irqreturn_t (*handler)(int, void *, struct pt_regs *),
- unsigned long irqflags,
- const char * devname,
- void *dev_id)
-{
- int retval;
- struct irqaction * action;
-
- /*
- * Sanity-check: shared interrupts should REALLY pass in
- * a real dev-ID, otherwise we'll have trouble later trying
- * to figure out which interrupt is which (messes up the
- * interrupt freeing logic etc).
- */
- if (irqflags & SA_SHIRQ) {
- if (!dev_id)
- printk(KERN_ERR "Bad boy: %s called us without a dev_id!\n", devname);
- }
-
- if (irq >= NR_IRQS)
- return -EINVAL;
- if (!handler)
- return -EINVAL;
-
- action = xmalloc(struct irqaction);
- if (!action)
- return -ENOMEM;
-
- action->handler = (void *) handler;
- action->name = devname;
- action->dev_id = dev_id;
-
- retval = setup_irq(irq, action);
- if (retval)
- xfree(action);
- return retval;
-}
-
-EXPORT_SYMBOL(request_irq);
-
-/**
- * free_irq - free an interrupt
- * @irq: Interrupt line to free
- * @dev_id: Device identity to free
- *
- * Remove an interrupt handler. The handler is removed and if the
- * interrupt line is no longer in use by any driver it is disabled.
- * On a shared IRQ the caller must ensure the interrupt is disabled
- * on the card it drives before calling this function. The function
- * does not return until any executing interrupts for this IRQ
- * have completed.
- *
- * This function must not be called from interrupt context.
- */
-
-void free_irq(unsigned int irq)
-{
- irq_desc_t *desc;
- unsigned long flags;
-
- if (irq >= NR_IRQS)
- return;
-
- desc = irq_descp(irq);
- spin_lock_irqsave(&desc->lock,flags);
- if (desc->action) {
- struct irqaction * action = desc->action;
- desc->action = NULL;
- desc->status |= IRQ_DISABLED;
- desc->handler->shutdown(irq);
- spin_unlock_irqrestore(&desc->lock,flags);
-
- /* Wait to make sure it's not being used on another CPU */
- synchronize_irq(irq);
- xfree(action);
- return;
- }
- printk(KERN_ERR "Trying to free free IRQ%d\n",irq);
- spin_unlock_irqrestore(&desc->lock,flags);
-}
-
-EXPORT_SYMBOL(free_irq);
-
/*
* IRQ autodetection code..
*
* disabled.
*/
-int setup_irq(unsigned int irq, struct irqaction * new)
+int setup_vector(unsigned int irq, struct irqaction * new)
{
unsigned long flags;
struct irqaction *old, **p;
irq_desc_t *desc = irq_descp(irq);
+ printf ("setup_vector(%d): handler=%p, flags=%x\n",
+ irq, desc->handler, desc->status);
+
/*
* The following block of code has to be executed atomically
*/
desc->depth = 0;
desc->status &= ~(IRQ_DISABLED | IRQ_INPROGRESS | IRQ_GUEST);
desc->handler->startup(irq);
+ desc->handler->enable(irq);
spin_unlock_irqrestore(&desc->lock,flags);
return 0;
}
+/* Vectors reserved by xen (and thus not sharable with domains). */
+unsigned long ia64_xen_vector[BITS_TO_LONGS(NR_IRQS)];
+
+int setup_irq(unsigned int irq, struct irqaction * new)
+{
+ unsigned int vec;
+ int res;
+
+ /* Get vector for IRQ. */
+ if (acpi_gsi_to_irq (irq, &vec) < 0)
+ return -ENOSYS;
+ /* Reserve the vector (and thus the irq). */
+ if (test_and_set_bit(vec, ia64_xen_vector))
+ return -EBUSY;
+ res = setup_vector (vec, new);
+ return res;
+}
+
/*
* HANDLING OF GUEST-BOUND PHYSICAL IRQS
*/
{
vcpu_pend_interrupt(dom0->vcpu[0],irq);
}
-
-void serial_input_init(void)
-{
- int retval;
- int irq = 0x30; // FIXME
-
- retval = request_irq(irq,guest_forward_keyboard_input,SA_INTERRUPT,"siminput",NULL);
- if (retval) {
- printk("serial_input_init: broken request_irq call\n");
- while(1);
- }
-}
extern unsigned long domain0_ready;
int find_max_pfn (unsigned long, unsigned long, void *);
-void start_of_day(void);
/* FIXME: which header these declarations should be there ? */
+extern void initialize_keytable(void);
extern long is_platform_hp_ski(void);
extern void early_setup_arch(char **);
extern void late_setup_arch(char **);
static unsigned int max_cpus = NR_CPUS;
integer_param("maxcpus", max_cpus);
+/* xencons: if true enable xenconsole input (and irq).
+ Note: you have to disable 8250 serials in domains (to avoid use of the
+ same resource). */
+static int opt_xencons = 0;
+boolean_param("xencons", opt_xencons);
+
/*
* opt_xenheap_megabytes: Size of Xen heap in megabytes, including:
* xen image
void start_kernel(void)
{
- unsigned char *cmdline;
+ char *cmdline;
void *heap_start;
unsigned long nr_pages;
unsigned long dom0_memory_start, dom0_memory_size;
/* Kernel may be relocated by EFI loader */
xen_pstart = ia64_tpa(KERNEL_START);
- early_setup_arch((char **) &cmdline);
+ early_setup_arch(&cmdline);
/* We initialise the serial devices very early so we can get debugging. */
if (running_on_sim) hpsim_serial_init();
idle_domain = domain_create(IDLE_DOMAIN_ID, 0);
BUG_ON(idle_domain == NULL);
- late_setup_arch((char **) &cmdline);
+ late_setup_arch(&cmdline);
alloc_dom_xen_and_dom_io();
setup_per_cpu_areas();
mem_init();
local_irq_disable();
init_IRQ ();
-printk("About to call init_xen_time()\n");
init_xen_time(); /* initialise the time */
-printk("About to call timer_init()\n");
timer_init();
-#ifdef CONFIG_XEN_CONSOLE_INPUT /* CONFIG_SERIAL_8250_CONSOLE=n in dom0! */
- initialize_keytable();
- serial_init_postirq();
-#endif
-
#ifdef CONFIG_SMP
if ( opt_nosmp )
{
printk("About to call sort_main_extable()\n");
sort_main_extable();
-
init_rid_allocator ();
+ local_irq_enable();
+
+ if (opt_xencons) {
+ initialize_keytable();
+ serial_init_postirq();
+ }
+
/* Create initial domain 0. */
printk("About to call domain_create()\n");
dom0 = domain_create(0, 0);
init_trace_bufs();
/* Give up the VGA console if DOM0 is configured to grab it. */
-#ifdef CONFIG_XEN_CONSOLE_INPUT /* CONFIG_SERIAL_8250_CONSOLE=n in dom0! */
- console_endboot(cmdline && strstr(cmdline, "tty0"));
-#endif
+ if (opt_xencons)
+ console_endboot(cmdline && strstr(cmdline, "tty0"));
domain0_ready = 1;
- local_irq_enable();
-
printf("About to call schedulers_start dom0=%p, idle_dom=%p\n",
dom0, idle_domain);
schedulers_start();